<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib  prefix="c"   uri="http://java.sun.com/jsp/jstl/core"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'QueryEmp.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->


  <script type="text/javascript" src="js/query.js"></script>
  
  
  </head>
  
  <body>
  	<jsp:include page="/jsp/head.jsp"></jsp:include>
  	
  	<a href="/WebDemo2/jsp/index.jsp" >返回</a>
  	
    	<h5>员工检索</h5> 
    	<form action="servlet/QueryEmpServlet"  name="frm">
    		Sex : <select name="sex" >
    			<option value="" >请选择性别</option>
    			<option value="0" >男</option>
    			<option value="1" >女</option>
    		</select> 
    	
    	Degree : 
    		<select name="degree" >
    			<option value="" >请选择学历</option>
    			<option value="专科" >专科</option>
    			<option value="本科" >本科</option>
    			<option value="硕士" >硕士</option>
    			<option value="博士" >博士</option>
    	
    		</select> 
		Name : 
			<input  type="text"  name="name" />
    		
    		<input type="hidden"  name="check"  value="">
    		
    	</form>
    	<button onclick ="sendData()">Query</button>
    		
    	
    	<div>
    	
    			<table border = "1">
		<tr>
			<td>序号</td>
			<td>姓名</td>
			<td>性别</td>
			<td>学历</td>
			<td>工作经历</td>
			<td>操作</td>
		</tr>
		<c:forEach  var="emp"   items="${ requestScope.emps }"  varStatus="index" >
			<tr>
				<td>${index.count }</td>
				<td>${emp.name }</td>
				<td>
					<c:if test="${emp.sex eq 0 }">
						<c:out value="男"></c:out>
					</c:if>
					<c:if test="${emp.sex eq 1 }">
						<c:out value="女"></c:out>
					</c:if>
				</td>
				<td>${emp.degree }</td>
				<td>${emp.work }</td>
				<td>
					<a href="servlet/EmpServlet?method=getEmp&id=${emp.id }">修改</a>
					<a href="servlet/EmpServlet?method=removeEmp&id=${emp.id }">删除</a>
				</td>

			</tr>
		</c:forEach>
		
		
	</table>
    		

    	</div>
    	
    
  </body>
</html>
